package com.arpa.wms.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * @author: Allen chen
 * @Date 2020/8/15
 * @Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="GoodsType对象", description="商品类别")
@TableName("base_goods_type")
public class GoodsType extends BasicEntity {

    private static final long serialVersionUID = 1L;

     /**
      *  @author: Allen chen
      *  @Date: 2020/8/15 9:52
      *  @Description: code
      */
     @ApiModelProperty(value = "全局标识")
     @TableField("code")
    private String code;

    @ApiModelProperty(value = "类别名称")
    @TableField("name")
    @NotBlank(message = "名称不能为空！")
    @Length(max = 100, message = "名称长度不能大于100")
    private String name;

    @ApiModelProperty(value = "类别编码")
    @TableField("type_code")
    @NotBlank(message = "编码不能为空！")
    @Length(max = 100, message = "编码长度不能大于100")
    private String typeCode;

    @ApiModelProperty(value = "级别")
    @TableField("level")
    private Integer level;

    @ApiModelProperty(value = "顺序")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty(value = "上级节点")
    @TableField("parent_code")
    private String parentCode;

    @ApiModelProperty(value = "上级节点名称")
    @TableField(exist = false)
    private String parentName;

    @ApiModelProperty(value = "所属货主")
    @TableField("shipment_code")
    private String shipmentCode;

    @ApiModelProperty(value = "所属货主名称")
    @TableField(exist = false)
    private String shipmentName;

    @ApiModelProperty(value = "是否可以添加子节点,ture-可以添加，false-不可添加")
    @TableField(exist = false)
    private Boolean canAdd;

    @ApiModelProperty(value = "所属机构")
    @TableField("group_code")
    private String groupCode;

}
